//
//  LGTextView.m
//  微博
//
//  Created by MS on 15-12-24.
//  Copyright (c) 2015年 MS. All rights reserved.
//

#import "LGTextView.h"

@interface LGTextView ()

@property (nonatomic,weak)  UILabel * placeHoldText;

@end

@implementation LGTextView

-(UILabel *)placeHoldText
{
    if (_placeHoldText==nil) {
        
        UILabel * lab = [[UILabel alloc] init];
        lab.textColor =[UIColor lightGrayColor];
        [self addSubview:lab];
        _placeHoldText = lab;
        
    }
    
    return _placeHoldText;
}

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        self.font = [UIFont systemFontOfSize:15];
        
    }
    return self;
    
}

-(void)setFont:(UIFont *)font
{
    [super setFont:font];
    
    self.placeHoldText.font = font;
    [self.placeHoldText sizeToFit];
}

-(void)setPlaceHold:(NSString *)placeHold
{
    _placeHold = placeHold;
    
    self.placeHoldText.text = placeHold;
    [_placeHoldText sizeToFit];
}

-(void)setHiddenplaceHold:(BOOL)hiddenplaceHold
{
    _hiddenplaceHold = hiddenplaceHold;
    self.placeHoldText.hidden = hiddenplaceHold;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.placeHoldText.x = 5;
    self.placeHoldText.y = 8;
}

@end
